<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "https://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/xhtml;charset=UTF-8"/>
<meta http-equiv="X-UA-Compatible" content="IE=9"/>
<meta name="generator" content="Doxygen 1.8.16"/>
<meta name="viewport" content="width=device-width, initial-scale=1"/>
<title>JCSDK Java API Reference for Android: com.juphoon.cloud.JCStorage Class Reference</title>
<link href="tabs.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="jquery.js"></script>
<script type="text/javascript" src="dynsections.js"></script>
<link href="search/search.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="search/searchdata.js"></script>
<script type="text/javascript" src="search/search.js"></script>
<link href="doxygen.css" rel="stylesheet" type="text/css" />
</head>
<body>
<div id="top"><!-- do not remove this div, it is closed by doxygen! -->
<div id="titlearea">
<table cellspacing="0" cellpadding="0">
 <tbody>
 <tr style="height: 56px;">
  <td id="projectalign" style="padding-left: 0.5em;">
   <div id="projectname">JCSDK Java API Reference for Android
   &#160;<span id="projectnumber">2.3.3</span>
   </div>
  </td>
 </tr>
 </tbody>
</table>
</div>
<!-- end header part -->
<!-- Generated by Doxygen 1.8.16 -->
<script type="text/javascript">
/* @license magnet:?xt=urn:btih:cf05388f2679ee054f2beb29a391d25f4e673ac3&amp;dn=gpl-2.0.txt GPL-v2 */
var searchBox = new SearchBox("searchBox", "search",false,'Search');
/* @license-end */
</script>
<script type="text/javascript" src="menudata.js"></script>
<script type="text/javascript" src="menu.js"></script>
<script type="text/javascript">
/* @license magnet:?xt=urn:btih:cf05388f2679ee054f2beb29a391d25f4e673ac3&amp;dn=gpl-2.0.txt GPL-v2 */
$(function() {
  initMenu('',true,false,'search.php','Search');
  $(document).ready(function() { init_search(); });
});
/* @license-end */</script>
<div id="main-nav"></div>
<!-- window showing the filter options -->
<div id="MSearchSelectWindow"
     onmouseover="return searchBox.OnSearchSelectShow()"
     onmouseout="return searchBox.OnSearchSelectHide()"
     onkeydown="return searchBox.OnSearchSelectKey(event)">
</div>

<!-- iframe showing the search results (closed by default) -->
<div id="MSearchResultsWindow">
<iframe src="javascript:void(0)" frameborder="0" 
        name="MSearchResults" id="MSearchResults">
</iframe>
</div>

<div id="nav-path" class="navpath">
  <ul>
<li class="navelem"><b>com</b></li><li class="navelem"><b>juphoon</b></li><li class="navelem"><b>cloud</b></li><li class="navelem"><a class="el" href="classcom_1_1juphoon_1_1cloud_1_1_j_c_storage.html">JCStorage</a></li>  </ul>
</div>
</div><!-- top -->
<div class="header">
  <div class="summary">
<a href="#pub-methods">Public Member Functions</a> &#124;
<a href="#pub-static-methods">Static Public Member Functions</a> &#124;
<a href="#pub-static-attribs">Static Public Attributes</a> &#124;
<a href="classcom_1_1juphoon_1_1cloud_1_1_j_c_storage-members.html">List of all members</a>  </div>
  <div class="headertitle">
<div class="title">com.juphoon.cloud.JCStorage Class Reference<span class="mlabels"><span class="mlabel">abstract</span></span><div class="ingroups"><a class="el" href="group___xE6_x96_x87_xE4_xBB_xB6_xE5_xAD_x98_xE5_x82_xA8_xE6_xA8_xA1_xE5_x9D_x97.html">文件存储模块</a></div></div>  </div>
</div><!--header-->
<div class="contents">

<p>Inherited by com.juphoon.cloud.JCStorageImpl.</p>
<table class="memberdecls">
<tr class="heading"><td colspan="2"><h2 class="groupheader"><a name="pub-methods"></a>
Public Member Functions</h2></td></tr>
<tr class="memitem:ae71bf7ebf3105917f4c4228dba486140"><td class="memItemLeft" align="right" valign="top">abstract <a class="el" href="classcom_1_1juphoon_1_1cloud_1_1_j_c_storage_item.html">JCStorageItem</a>&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classcom_1_1juphoon_1_1cloud_1_1_j_c_storage.html#ae71bf7ebf3105917f4c4228dba486140">uploadFileByExpireTime</a> (String path, int expiredSeconds, long cookie)</td></tr>
<tr class="separator:ae71bf7ebf3105917f4c4228dba486140"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a1ed923b8936968c5f6aaf6bf3ae09f19"><td class="memItemLeft" align="right" valign="top">abstract <a class="el" href="classcom_1_1juphoon_1_1cloud_1_1_j_c_storage_item.html">JCStorageItem</a>&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classcom_1_1juphoon_1_1cloud_1_1_j_c_storage.html#a1ed923b8936968c5f6aaf6bf3ae09f19">downloadFile</a> (String uri, String savePath, long cookie)</td></tr>
<tr class="separator:a1ed923b8936968c5f6aaf6bf3ae09f19"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a792bda549844d3ca480723302a029ba1"><td class="memItemLeft" align="right" valign="top">abstract boolean&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classcom_1_1juphoon_1_1cloud_1_1_j_c_storage.html#a792bda549844d3ca480723302a029ba1">cancelFile</a> (@NonNull <a class="el" href="classcom_1_1juphoon_1_1cloud_1_1_j_c_storage_item.html">JCStorageItem</a> item)</td></tr>
<tr class="separator:a792bda549844d3ca480723302a029ba1"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a1879b0f85f683a643ac9369de2929d10"><td class="memItemLeft" align="right" valign="top">abstract boolean&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classcom_1_1juphoon_1_1cloud_1_1_j_c_storage.html#a1879b0f85f683a643ac9369de2929d10">cancelFileByCookie</a> (int cookie)</td></tr>
<tr class="separator:a1879b0f85f683a643ac9369de2929d10"><td class="memSeparator" colspan="2">&#160;</td></tr>
</table><table class="memberdecls">
<tr class="heading"><td colspan="2"><h2 class="groupheader"><a name="pub-static-methods"></a>
Static Public Member Functions</h2></td></tr>
<tr class="memitem:ad8f487e1b4afe54397cecc759647668c"><td class="memItemLeft" align="right" valign="top">static <a class="el" href="classcom_1_1juphoon_1_1cloud_1_1_j_c_storage.html">JCStorage</a>&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classcom_1_1juphoon_1_1cloud_1_1_j_c_storage.html#ad8f487e1b4afe54397cecc759647668c">create</a> (<a class="el" href="classcom_1_1juphoon_1_1cloud_1_1_j_c_client.html">JCClient</a> client, <a class="el" href="interfacecom_1_1juphoon_1_1cloud_1_1_j_c_storage_callback.html">JCStorageCallback</a> callback)</td></tr>
<tr class="separator:ad8f487e1b4afe54397cecc759647668c"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:aecc80e284ef189fa0e799a7d7dd9bc00"><td class="memItemLeft" align="right" valign="top">static void&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classcom_1_1juphoon_1_1cloud_1_1_j_c_storage.html#aecc80e284ef189fa0e799a7d7dd9bc00">destroy</a> ()</td></tr>
<tr class="separator:aecc80e284ef189fa0e799a7d7dd9bc00"><td class="memSeparator" colspan="2">&#160;</td></tr>
</table><table class="memberdecls">
<tr class="heading"><td colspan="2"><h2 class="groupheader"><a name="pub-static-attribs"></a>
Static Public Attributes</h2></td></tr>
<tr class="memitem:ga6c62a4eaaf6ba50f3a1a7fe13507966f"><td class="memItemLeft" align="right" valign="top">static final int&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="group__error.html#ga6c62a4eaaf6ba50f3a1a7fe13507966f">REASON_NONE</a> = 0</td></tr>
<tr class="separator:ga6c62a4eaaf6ba50f3a1a7fe13507966f"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:ga20919ad3b193dc1b9d6cbc6fa49d1c00"><td class="memItemLeft" align="right" valign="top">static final int&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="group__error.html#ga20919ad3b193dc1b9d6cbc6fa49d1c00">REASON_NOT_LOGIN</a> = 1</td></tr>
<tr class="separator:ga20919ad3b193dc1b9d6cbc6fa49d1c00"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:ga41a0045e434f97e7332aba3f8657cadf"><td class="memItemLeft" align="right" valign="top">static final int&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="group__error.html#ga41a0045e434f97e7332aba3f8657cadf">REASON_NETWORK</a> = 2</td></tr>
<tr class="separator:ga41a0045e434f97e7332aba3f8657cadf"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:gae9ff86f46ca80e858109f34ccded33df"><td class="memItemLeft" align="right" valign="top">static final int&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="group__error.html#gae9ff86f46ca80e858109f34ccded33df">REASON_TOOLARGE</a> = 30</td></tr>
<tr class="separator:gae9ff86f46ca80e858109f34ccded33df"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:gaf19d48dd40fa6717a78a3c8d0fff8452"><td class="memItemLeft" align="right" valign="top">static final int&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="group__error.html#gaf19d48dd40fa6717a78a3c8d0fff8452">REASON_TIMEOUT</a> = 31</td></tr>
<tr class="separator:gaf19d48dd40fa6717a78a3c8d0fff8452"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:gaf8755aa7fbd9738d82cad5a8566a4d32"><td class="memItemLeft" align="right" valign="top">static final int&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="group__error.html#gaf8755aa7fbd9738d82cad5a8566a4d32">REASON_EXPIRE</a> = 32</td></tr>
<tr class="separator:gaf8755aa7fbd9738d82cad5a8566a4d32"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:ga3fc1c2148841a6b404367394e73b849f"><td class="memItemLeft" align="right" valign="top">static final int&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="group__error.html#ga3fc1c2148841a6b404367394e73b849f">REASON_OTHER</a> = 100</td></tr>
<tr class="separator:ga3fc1c2148841a6b404367394e73b849f"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:ac7ab0798965d81ebeb6bb4ba4f2e3912"><td class="memItemLeft" align="right" valign="top">static final int&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classcom_1_1juphoon_1_1cloud_1_1_j_c_storage.html#ac7ab0798965d81ebeb6bb4ba4f2e3912">ITEM_STATE_INIT</a> = 0</td></tr>
<tr class="separator:ac7ab0798965d81ebeb6bb4ba4f2e3912"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:ac65aceaa369b21b20772081f90f3e19f"><td class="memItemLeft" align="right" valign="top">static final int&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classcom_1_1juphoon_1_1cloud_1_1_j_c_storage.html#ac65aceaa369b21b20772081f90f3e19f">ITEM_STATE_TRANSFERRING</a> = 1</td></tr>
<tr class="separator:ac65aceaa369b21b20772081f90f3e19f"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a9cd1c58b2bb250962057f302cf8aefbd"><td class="memItemLeft" align="right" valign="top">static final int&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classcom_1_1juphoon_1_1cloud_1_1_j_c_storage.html#a9cd1c58b2bb250962057f302cf8aefbd">ITEM_STATE_OK</a> = 2</td></tr>
<tr class="separator:a9cd1c58b2bb250962057f302cf8aefbd"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:af650fdf32e3081c32499f5af2b2dd100"><td class="memItemLeft" align="right" valign="top">static final int&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classcom_1_1juphoon_1_1cloud_1_1_j_c_storage.html#af650fdf32e3081c32499f5af2b2dd100">ITEM_STATE_FAIL</a> = 3</td></tr>
<tr class="separator:af650fdf32e3081c32499f5af2b2dd100"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a26ba524d8266c7873b7a9ce69065598a"><td class="memItemLeft" align="right" valign="top">static final int&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classcom_1_1juphoon_1_1cloud_1_1_j_c_storage.html#a26ba524d8266c7873b7a9ce69065598a">ITEM_STATE_CANCEL</a> = 4</td></tr>
<tr class="separator:a26ba524d8266c7873b7a9ce69065598a"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:ac779354c2bcb777b7803a3f75f21e015"><td class="memItemLeft" align="right" valign="top">static final int&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classcom_1_1juphoon_1_1cloud_1_1_j_c_storage.html#ac779354c2bcb777b7803a3f75f21e015">DIRECTION_UPLOAD</a> = 0</td></tr>
<tr class="separator:ac779354c2bcb777b7803a3f75f21e015"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:af19ef8057df6b3d5fe11aaec219459a4"><td class="memItemLeft" align="right" valign="top">static final int&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classcom_1_1juphoon_1_1cloud_1_1_j_c_storage.html#af19ef8057df6b3d5fe11aaec219459a4">DIRECTION_DOWNLOAD</a> = 1</td></tr>
<tr class="separator:af19ef8057df6b3d5fe11aaec219459a4"><td class="memSeparator" colspan="2">&#160;</td></tr>
</table>
<a name="details" id="details"></a><h2 class="groupheader">Detailed Description</h2>
<div class="textblock"><p>用于上传下载文件 </p>
</div><h2 class="groupheader">Member Function Documentation</h2>
<a id="ad8f487e1b4afe54397cecc759647668c"></a>
<h2 class="memtitle"><span class="permalink"><a href="#ad8f487e1b4afe54397cecc759647668c">&#9670;&nbsp;</a></span>create()</h2>

<div class="memitem">
<div class="memproto">
<table class="mlabels">
  <tr>
  <td class="mlabels-left">
      <table class="memname">
        <tr>
          <td class="memname">static <a class="el" href="classcom_1_1juphoon_1_1cloud_1_1_j_c_storage.html">JCStorage</a> com.juphoon.cloud.JCStorage.create </td>
          <td>(</td>
          <td class="paramtype"><a class="el" href="classcom_1_1juphoon_1_1cloud_1_1_j_c_client.html">JCClient</a>&#160;</td>
          <td class="paramname"><em>client</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype"><a class="el" href="interfacecom_1_1juphoon_1_1cloud_1_1_j_c_storage_callback.html">JCStorageCallback</a>&#160;</td>
          <td class="paramname"><em>callback</em>&#160;</td>
        </tr>
        <tr>
          <td></td>
          <td>)</td>
          <td></td><td></td>
        </tr>
      </table>
  </td>
  <td class="mlabels-right">
<span class="mlabels"><span class="mlabel">inline</span><span class="mlabel">static</span></span>  </td>
  </tr>
</table>
</div><div class="memdoc">
<p>创建 <a class="el" href="classcom_1_1juphoon_1_1cloud_1_1_j_c_storage.html">JCStorage</a> 对象</p>
<p><a class="el" href="classcom_1_1juphoon_1_1cloud_1_1_j_c_storage.html">JCStorage</a> 的所有接口函数，如无特殊说明，都建议在主线程调用</p>
<dl class="section note"><dt>Note</dt><dd><ul>
<li>调用此方法创建 <a class="el" href="classcom_1_1juphoon_1_1cloud_1_1_j_c_storage.html">JCStorage</a> 对象后，期间没有调用过 <a class="el" href="classcom_1_1juphoon_1_1cloud_1_1_j_c_storage.html#aecc80e284ef189fa0e799a7d7dd9bc00">destroy</a> 方法销毁对象，然后又重复调用此方法，会直接返回第一次创建的 <a class="el" href="classcom_1_1juphoon_1_1cloud_1_1_j_c_storage.html">JCStorage</a> 对象</li>
<li>调用此方法前确保 <a class="el" href="classcom_1_1juphoon_1_1cloud_1_1_j_c_client.html">JCClient</a> 已完成初始化，即 <a class="el" href="classcom_1_1juphoon_1_1cloud_1_1_j_c_client.html#a9662a6f13921508ebefa58b0d684f6cd">getState</a> 方法获取的状态值不等于 <a class="el" href="classcom_1_1juphoon_1_1cloud_1_1_j_c_client.html#a9265e400dcb439ba508abd30174c380d">STATE_NOT_INIT</a></li>
</ul>
</dd></dl>
<dl class="params"><dt>Parameters</dt><dd>
  <table class="params">
    <tr><td class="paramname">client</td><td><a class="el" href="classcom_1_1juphoon_1_1cloud_1_1_j_c_client.html">JCClient</a> 对象 </td></tr>
    <tr><td class="paramname">callback</td><td><a class="el" href="interfacecom_1_1juphoon_1_1cloud_1_1_j_c_storage_callback.html">JCStorageCallback</a> 对象，用于回调相关通知 </td></tr>
  </table>
  </dd>
</dl>
<dl class="section return"><dt>Returns</dt><dd><a class="el" href="classcom_1_1juphoon_1_1cloud_1_1_j_c_storage.html">JCStorage</a> 对象 </dd></dl>
<dl class="exception"><dt>Exceptions</dt><dd>
  <table class="exception">
    <tr><td class="paramname">JCClient、JCStorageCallback 任意一个参数传空就会出现调用异常</td><td></td></tr>
  </table>
  </dd>
</dl>

</div>
</div>
<a id="aecc80e284ef189fa0e799a7d7dd9bc00"></a>
<h2 class="memtitle"><span class="permalink"><a href="#aecc80e284ef189fa0e799a7d7dd9bc00">&#9670;&nbsp;</a></span>destroy()</h2>

<div class="memitem">
<div class="memproto">
<table class="mlabels">
  <tr>
  <td class="mlabels-left">
      <table class="memname">
        <tr>
          <td class="memname">static void com.juphoon.cloud.JCStorage.destroy </td>
          <td>(</td>
          <td class="paramname"></td><td>)</td>
          <td></td>
        </tr>
      </table>
  </td>
  <td class="mlabels-right">
<span class="mlabels"><span class="mlabel">inline</span><span class="mlabel">static</span></span>  </td>
  </tr>
</table>
</div><div class="memdoc">
<p>销毁 <a class="el" href="classcom_1_1juphoon_1_1cloud_1_1_j_c_storage.html">JCStorage</a> 对象</p>
<dl class="section note"><dt>Note</dt><dd>此方法为异步调用，所以在调用此方法后不能马上调用 <a class="el" href="classcom_1_1juphoon_1_1cloud_1_1_j_c_storage.html#ad8f487e1b4afe54397cecc759647668c">create</a> 方法去重新创建 <a class="el" href="classcom_1_1juphoon_1_1cloud_1_1_j_c_storage.html">JCStorage</a> 对象 </dd></dl>

</div>
</div>
<a id="ae71bf7ebf3105917f4c4228dba486140"></a>
<h2 class="memtitle"><span class="permalink"><a href="#ae71bf7ebf3105917f4c4228dba486140">&#9670;&nbsp;</a></span>uploadFileByExpireTime()</h2>

<div class="memitem">
<div class="memproto">
<table class="mlabels">
  <tr>
  <td class="mlabels-left">
      <table class="memname">
        <tr>
          <td class="memname">abstract <a class="el" href="classcom_1_1juphoon_1_1cloud_1_1_j_c_storage_item.html">JCStorageItem</a> com.juphoon.cloud.JCStorage.uploadFileByExpireTime </td>
          <td>(</td>
          <td class="paramtype">String&#160;</td>
          <td class="paramname"><em>path</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">int&#160;</td>
          <td class="paramname"><em>expiredSeconds</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">long&#160;</td>
          <td class="paramname"><em>cookie</em>&#160;</td>
        </tr>
        <tr>
          <td></td>
          <td>)</td>
          <td></td><td></td>
        </tr>
      </table>
  </td>
  <td class="mlabels-right">
<span class="mlabels"><span class="mlabel">abstract</span></span>  </td>
  </tr>
</table>
</div><div class="memdoc">
<p>上传文件</p>
<dl class="params"><dt>Parameters</dt><dd>
  <table class="params">
    <tr><td class="paramname">path</td><td>文件路径，需精确到文件名及格式，例如：/sdcard/emulated/0/audio.wmv。请确保目录存在。 </td></tr>
    <tr><td class="paramname">cookie</td><td>标志数据 </td></tr>
    <tr><td class="paramname">expiredSeconds</td><td>过期秒数，-1表示永久 </td></tr>
  </table>
  </dd>
</dl>
<dl class="section return"><dt>Returns</dt><dd><ul>
<li><a class="el" href="classcom_1_1juphoon_1_1cloud_1_1_j_c_storage_item.html">JCStorageItem</a> 对象：<ul>
<li>调用底层接口成功，返回的 <a class="el" href="classcom_1_1juphoon_1_1cloud_1_1_j_c_storage_item.html">JCStorageItem</a> 对象的状态为 ITEM_STATE_TRANSFERRING，并且会收到 <a class="el" href="interfacecom_1_1juphoon_1_1cloud_1_1_j_c_storage_callback.html#acacddb11d68e9b76a81c4d69ac8073ed">JCStorageCallback.onFileUpdate</a> 回调</li>
<li>调用底层接口失败，返回的 <a class="el" href="classcom_1_1juphoon_1_1cloud_1_1_j_c_storage_item.html">JCStorageItem</a> 对象的状态为 ITEM_STATE_FAIL，并且会收到 <a class="el" href="interfacecom_1_1juphoon_1_1cloud_1_1_j_c_storage_callback.html#a5ad2d18ca18210b0979c883a6258d085">JCStorageCallback.onFileResult</a> 回调</li>
</ul>
</li>
<li>null：异常调用，不会收到回调 </li>
</ul>
</dd></dl>

</div>
</div>
<a id="a1ed923b8936968c5f6aaf6bf3ae09f19"></a>
<h2 class="memtitle"><span class="permalink"><a href="#a1ed923b8936968c5f6aaf6bf3ae09f19">&#9670;&nbsp;</a></span>downloadFile()</h2>

<div class="memitem">
<div class="memproto">
<table class="mlabels">
  <tr>
  <td class="mlabels-left">
      <table class="memname">
        <tr>
          <td class="memname">abstract <a class="el" href="classcom_1_1juphoon_1_1cloud_1_1_j_c_storage_item.html">JCStorageItem</a> com.juphoon.cloud.JCStorage.downloadFile </td>
          <td>(</td>
          <td class="paramtype">String&#160;</td>
          <td class="paramname"><em>uri</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">String&#160;</td>
          <td class="paramname"><em>savePath</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">long&#160;</td>
          <td class="paramname"><em>cookie</em>&#160;</td>
        </tr>
        <tr>
          <td></td>
          <td>)</td>
          <td></td><td></td>
        </tr>
      </table>
  </td>
  <td class="mlabels-right">
<span class="mlabels"><span class="mlabel">abstract</span></span>  </td>
  </tr>
</table>
</div><div class="memdoc">
<p>下载文件</p>
<dl class="params"><dt>Parameters</dt><dd>
  <table class="params">
    <tr><td class="paramname">uri</td><td>文件地址 </td></tr>
    <tr><td class="paramname">savePath</td><td>本地文件保存地址，由用户自行指定，需精确到文件名及格式，例如：/sdcard/emulated/0/audio.wmv。请确保目录存在且可写。 </td></tr>
    <tr><td class="paramname">cookie</td><td>标志数据 </td></tr>
  </table>
  </dd>
</dl>
<dl class="section return"><dt>Returns</dt><dd><ul>
<li><a class="el" href="classcom_1_1juphoon_1_1cloud_1_1_j_c_storage_item.html">JCStorageItem</a> 对象：<ul>
<li>调用底层接口成功，返回的 <a class="el" href="classcom_1_1juphoon_1_1cloud_1_1_j_c_storage_item.html">JCStorageItem</a> 对象的状态为 ITEM_STATE_TRANSFERRING，并且会收到 <a class="el" href="interfacecom_1_1juphoon_1_1cloud_1_1_j_c_storage_callback.html#acacddb11d68e9b76a81c4d69ac8073ed">JCStorageCallback.onFileUpdate</a> 回调</li>
<li>调用底层接口失败，返回的 <a class="el" href="classcom_1_1juphoon_1_1cloud_1_1_j_c_storage_item.html">JCStorageItem</a> 对象的状态为 ITEM_STATE_FAIL，并且会收到 <a class="el" href="interfacecom_1_1juphoon_1_1cloud_1_1_j_c_storage_callback.html#a5ad2d18ca18210b0979c883a6258d085">JCStorageCallback.onFileResult</a> 回调</li>
</ul>
</li>
<li>null：异常调用，不会收到回调 </li>
</ul>
</dd></dl>

</div>
</div>
<a id="a792bda549844d3ca480723302a029ba1"></a>
<h2 class="memtitle"><span class="permalink"><a href="#a792bda549844d3ca480723302a029ba1">&#9670;&nbsp;</a></span>cancelFile()</h2>

<div class="memitem">
<div class="memproto">
<table class="mlabels">
  <tr>
  <td class="mlabels-left">
      <table class="memname">
        <tr>
          <td class="memname">abstract boolean com.juphoon.cloud.JCStorage.cancelFile </td>
          <td>(</td>
          <td class="paramtype">@NonNull <a class="el" href="classcom_1_1juphoon_1_1cloud_1_1_j_c_storage_item.html">JCStorageItem</a>&#160;</td>
          <td class="paramname"><em>item</em></td><td>)</td>
          <td></td>
        </tr>
      </table>
  </td>
  <td class="mlabels-right">
<span class="mlabels"><span class="mlabel">abstract</span></span>  </td>
  </tr>
</table>
</div><div class="memdoc">
<p>取消正在进行的文件上传下载</p>
<dl class="params"><dt>Parameters</dt><dd>
  <table class="params">
    <tr><td class="paramname">item</td><td><a class="el" href="classcom_1_1juphoon_1_1cloud_1_1_j_c_storage_item.html">JCStorageItem</a> 对象，由 @ref downloadFile 方法返回 </td></tr>
  </table>
  </dd>
</dl>
<dl class="section return"><dt>Returns</dt><dd><ul>
<li>true: 成功，会收到 <a class="el" href="interfacecom_1_1juphoon_1_1cloud_1_1_j_c_storage_callback.html#a5ad2d18ca18210b0979c883a6258d085">JCStorageCallback.onFileResult</a> 回调</li>
<li>false: 失败，不会收到回调 </li>
</ul>
</dd></dl>

</div>
</div>
<a id="a1879b0f85f683a643ac9369de2929d10"></a>
<h2 class="memtitle"><span class="permalink"><a href="#a1879b0f85f683a643ac9369de2929d10">&#9670;&nbsp;</a></span>cancelFileByCookie()</h2>

<div class="memitem">
<div class="memproto">
<table class="mlabels">
  <tr>
  <td class="mlabels-left">
      <table class="memname">
        <tr>
          <td class="memname">abstract boolean com.juphoon.cloud.JCStorage.cancelFileByCookie </td>
          <td>(</td>
          <td class="paramtype">int&#160;</td>
          <td class="paramname"><em>cookie</em></td><td>)</td>
          <td></td>
        </tr>
      </table>
  </td>
  <td class="mlabels-right">
<span class="mlabels"><span class="mlabel">abstract</span></span>  </td>
  </tr>
</table>
</div><div class="memdoc">
<p>通过cookie取消正在进行的文件上传下载</p>
<p>通过 cookie 来匹配缓存中的 <a class="el" href="classcom_1_1juphoon_1_1cloud_1_1_j_c_storage_item.html">JCStorageItem</a> 对象</p><ul>
<li>若能匹配上，则会调用 <a class="el" href="classcom_1_1juphoon_1_1cloud_1_1_j_c_storage.html#a792bda549844d3ca480723302a029ba1">cancelFile</a> 方法并它提供返回值</li>
<li>若匹配不上，则会直接返回 false</li>
</ul>
<dl class="params"><dt>Parameters</dt><dd>
  <table class="params">
    <tr><td class="paramname">cookie</td><td>上传下载传入的 cookie </td></tr>
  </table>
  </dd>
</dl>
<dl class="section return"><dt>Returns</dt><dd><ul>
<li>true: 成功</li>
<li>false: 失败 </li>
</ul>
</dd></dl>

</div>
</div>
<h2 class="groupheader">Member Data Documentation</h2>
<a id="ac7ab0798965d81ebeb6bb4ba4f2e3912"></a>
<h2 class="memtitle"><span class="permalink"><a href="#ac7ab0798965d81ebeb6bb4ba4f2e3912">&#9670;&nbsp;</a></span>ITEM_STATE_INIT</h2>

<div class="memitem">
<div class="memproto">
<table class="mlabels">
  <tr>
  <td class="mlabels-left">
      <table class="memname">
        <tr>
          <td class="memname">final int com.juphoon.cloud.JCStorage.ITEM_STATE_INIT = 0</td>
        </tr>
      </table>
  </td>
  <td class="mlabels-right">
<span class="mlabels"><span class="mlabel">static</span></span>  </td>
  </tr>
</table>
</div><div class="memdoc">
<p>文件初始状态 </p>

</div>
</div>
<a id="ac65aceaa369b21b20772081f90f3e19f"></a>
<h2 class="memtitle"><span class="permalink"><a href="#ac65aceaa369b21b20772081f90f3e19f">&#9670;&nbsp;</a></span>ITEM_STATE_TRANSFERRING</h2>

<div class="memitem">
<div class="memproto">
<table class="mlabels">
  <tr>
  <td class="mlabels-left">
      <table class="memname">
        <tr>
          <td class="memname">final int com.juphoon.cloud.JCStorage.ITEM_STATE_TRANSFERRING = 1</td>
        </tr>
      </table>
  </td>
  <td class="mlabels-right">
<span class="mlabels"><span class="mlabel">static</span></span>  </td>
  </tr>
</table>
</div><div class="memdoc">
<p>文件传输中状态 </p>

</div>
</div>
<a id="a9cd1c58b2bb250962057f302cf8aefbd"></a>
<h2 class="memtitle"><span class="permalink"><a href="#a9cd1c58b2bb250962057f302cf8aefbd">&#9670;&nbsp;</a></span>ITEM_STATE_OK</h2>

<div class="memitem">
<div class="memproto">
<table class="mlabels">
  <tr>
  <td class="mlabels-left">
      <table class="memname">
        <tr>
          <td class="memname">final int com.juphoon.cloud.JCStorage.ITEM_STATE_OK = 2</td>
        </tr>
      </table>
  </td>
  <td class="mlabels-right">
<span class="mlabels"><span class="mlabel">static</span></span>  </td>
  </tr>
</table>
</div><div class="memdoc">
<p>文件传输成功状态 </p>

</div>
</div>
<a id="af650fdf32e3081c32499f5af2b2dd100"></a>
<h2 class="memtitle"><span class="permalink"><a href="#af650fdf32e3081c32499f5af2b2dd100">&#9670;&nbsp;</a></span>ITEM_STATE_FAIL</h2>

<div class="memitem">
<div class="memproto">
<table class="mlabels">
  <tr>
  <td class="mlabels-left">
      <table class="memname">
        <tr>
          <td class="memname">final int com.juphoon.cloud.JCStorage.ITEM_STATE_FAIL = 3</td>
        </tr>
      </table>
  </td>
  <td class="mlabels-right">
<span class="mlabels"><span class="mlabel">static</span></span>  </td>
  </tr>
</table>
</div><div class="memdoc">
<p>文件传输失败状态 </p>

</div>
</div>
<a id="a26ba524d8266c7873b7a9ce69065598a"></a>
<h2 class="memtitle"><span class="permalink"><a href="#a26ba524d8266c7873b7a9ce69065598a">&#9670;&nbsp;</a></span>ITEM_STATE_CANCEL</h2>

<div class="memitem">
<div class="memproto">
<table class="mlabels">
  <tr>
  <td class="mlabels-left">
      <table class="memname">
        <tr>
          <td class="memname">final int com.juphoon.cloud.JCStorage.ITEM_STATE_CANCEL = 4</td>
        </tr>
      </table>
  </td>
  <td class="mlabels-right">
<span class="mlabels"><span class="mlabel">static</span></span>  </td>
  </tr>
</table>
</div><div class="memdoc">
<p>文件传输取消状态 </p>

</div>
</div>
<a id="ac779354c2bcb777b7803a3f75f21e015"></a>
<h2 class="memtitle"><span class="permalink"><a href="#ac779354c2bcb777b7803a3f75f21e015">&#9670;&nbsp;</a></span>DIRECTION_UPLOAD</h2>

<div class="memitem">
<div class="memproto">
<table class="mlabels">
  <tr>
  <td class="mlabels-left">
      <table class="memname">
        <tr>
          <td class="memname">final int com.juphoon.cloud.JCStorage.DIRECTION_UPLOAD = 0</td>
        </tr>
      </table>
  </td>
  <td class="mlabels-right">
<span class="mlabels"><span class="mlabel">static</span></span>  </td>
  </tr>
</table>
</div><div class="memdoc">
<p>上传 </p>

</div>
</div>
<a id="af19ef8057df6b3d5fe11aaec219459a4"></a>
<h2 class="memtitle"><span class="permalink"><a href="#af19ef8057df6b3d5fe11aaec219459a4">&#9670;&nbsp;</a></span>DIRECTION_DOWNLOAD</h2>

<div class="memitem">
<div class="memproto">
<table class="mlabels">
  <tr>
  <td class="mlabels-left">
      <table class="memname">
        <tr>
          <td class="memname">final int com.juphoon.cloud.JCStorage.DIRECTION_DOWNLOAD = 1</td>
        </tr>
      </table>
  </td>
  <td class="mlabels-right">
<span class="mlabels"><span class="mlabel">static</span></span>  </td>
  </tr>
</table>
</div><div class="memdoc">
<p>下载 </p>

</div>
</div>
<hr/>The documentation for this class was generated from the following file:<ul>
<li>cloud/src/main/im/com/juphoon/cloud/JCStorage.java</li>
</ul>
</div><!-- contents -->
<!-- start footer part -->
<hr class="footer"/><address class="footer"><small>
Generated by &#160;<a href="http://www.doxygen.org/index.html">
<img class="footer" src="doxygen.png" alt="doxygen"/>
</a> 1.8.16
</small></address>
</body>
</html>
